<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'edit.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<link rel="stylesheet" href="css/center.css" type="text/css">
<script type="text/javascript" src="jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="jquery.validate-1.13.1.js"></script>
<script type="text/javascript" src="js/check.js"></script>
<script type="text/javascript" src="js/validator.js"></script>
<!-- <script type="text/javascript">
	$(function() {
		jQuery.validator.addMethod("isLegal", function(value, element) {
			var result = false;
			//先判断是否包含特殊字符
			var special = /[@\/'\\"#$%&￥\^*]/.test(value);
			var s = /[\n\r]/.test(value);
			//若为true  包含特殊字符  将其替换为空 
			var reg = /[@\/'\\"#$%&￥\^*]/g;
			var reg1 = /[\n\r]/g;
			//r为用来测试  真正写入的是text
			var r = value.replace(reg, '');
			var r1 = r.replace(reg1, "");
			//此时为只剩下符合字符或为空
			if (r1 == "") {
			} else {
				//判断是否只有符合的字符或字
				var reg = /^[a-zA-Z0-9\u4e00-\u9fa5-_]+$/;
				var re = reg.test(r1);
				if (re) {
					result = true;
				}
			}
			//表单验证
			return result;

		}, "请勿发无效信息！");

		$("#updateTextForm").validate({

			rules : {
				"bothText.text" : {
					required : true,
					isLegal : true,
				}
			},
			messages : {
				"userText.text" : {
					required : "所发布的信息不能为空",
					isLegal : "请勿发无效信息！",
				}
			},
			focusInvalid : true,
		});
	});
</script> -->

</head>
<body>
	<form action="bothtext_updateTextByadmin" id="updateTextForm"
		method="post" class="From" style="margin-top: 30px;width: 480px;">
		<ul>
			<li>广告内容:</li>
			<li><textarea name="bothText.text" id="TextArea1" onkeyup="checkLength120(this);"
					 style="width:470px;height:100px;"><s:property value="bothText.text"/></textarea></li>
			<li style="margin-top: 90px;"><span class="wordage">剩余字数：<span
					id="sy" style="color:Red;"></span> </span></li>
			<li><input type="submit" value="确认修改" class="buttonSubmit">
			</li>
		</ul>

		<input type="hidden" name="bothText.textId" value="${bothText.textId}">
		<input type="hidden" name="bothText.sendId" value="${bothText.sendId}">
		<input type="hidden" name="bothText.sendDate"
			value="${bothText.sendDate}"> <input type="hidden"
			name="bothText.limiteDate" value="${bothText.limiteDate}"> <input
			type="hidden" name="bothText.tag" value="${bothText.tag}"> <input
			type="hidden" name="bothText.image" value="${bothText.image}">
	</form>
</body>
</html>
